/* Copyright 2009 Requirements Management System 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.mags.remas.model.entity;

// Generated Dec 16, 2009 10:43:06 PM by Hibernate Tools 3.2.2.GA

import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;


/**
 * Entity generated by hbm2java
 */
public class Entity implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	private long entityId;
	private long version;
	private String createdBy;
	private String updatedBy;
	private Date creationDate;
	private Date changeDate;
	private String name;
	private String code;	
	private String description;
	private EntityStatus entityStatus;
	private EntityType entityType;
	private Set<EntityComment> entityComments = new HashSet<EntityComment>(0);
	private Set<KeyValue> keyValues = new HashSet<KeyValue>(0);
	private Set<ListValue> listValues = new HashSet<ListValue>(0);
	/*DUMMY FIELDS*/
	private Map<String, Object> keys=new HashMap<String, Object>(0);
	

	public KeyValue getKeyValue(String name) {
		if(keyValues!=null) {
			for(KeyValue i: keyValues) 
				if(i.getKeyDefinition().getName().equalsIgnoreCase(name))
					return i;
		}
		return null;
	}
	
	public Set<ListValue> getListValues() {
		return listValues;
	}

	public void setListValues(Set<ListValue> listValues) {
		this.listValues = listValues;
	}

	public Set<KeyValue> getKeyValues() {
		return keyValues;
	}

	public void setKeyValues(Set<KeyValue> keyValues) {
		this.keyValues = keyValues;
	}

	public Set<EntityComment> getEntityComments() {
		return entityComments;
	}

	public void setEntityComments(Set<EntityComment> entityComments) {
		this.entityComments = entityComments;
	}

	public Map<String, Object> getKeys() {
		return keys;
	}

	public void setKeys(Map<String, Object> keys) {
		this.keys = keys;
	}

	public EntityStatus getEntityStatus() {
		return entityStatus;
	}

	public void setEntityStatus(EntityStatus entityStatus) {
		this.entityStatus = entityStatus;
	}

	public EntityType getEntityType() {
		return entityType;
	}

	public void setEntityType(EntityType entityType) {
		this.entityType = entityType;
	}

	public Entity() {
	}

	public long getEntityId() {
		return this.entityId;
	}

	public void setEntityId(long entityId) {
		this.entityId = entityId;
	}

	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public Date getChangeDate() {
		return this.changeDate;
	}

	public void setChangeDate(Date changeDate) {
		this.changeDate = changeDate;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	public String getDescription() {
		return this.description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}

}
